Support built-in thumbnail creation on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Thu, 30 May 2024 14:45:33 +0000 (17:45 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 30 May 2024 14:45:33 +0000 (17:45 +0300)
commitae7d0e86b37eabc434c48f85f56df0a221e0e7c7
tree6b4c65c594e47ee09f6a0b1fc6dc3856802bfe81
parent1ebb9cb93b2fefa84f18a63fb24c1ed4fcf095a7
Support built-in thumbnail creation on MS-Windows

* src/w32image.c (get_encoder_clsid, Fw32image_create_thumbnail)
(globals_of_w32image, syms_of_w32image): New functions.
* src/emacs.c (main): Call 'syms_of_w32image' and
'globals_of_w32image'.
* src/w32term.h (syms_of_w32image, globals_of_w32image): Add
prototypes.

* lisp/image/image-dired.el
(image-dired-thumbnail-display-external): Add a fallback for
MS-Windows.
* lisp/image/image-dired-external.el
(image-dired--probe-thumbnail-cmd): New function.
(image-dired--check-executable-exists): Call it to verify that
"convert" is indeed an Imagemagick program.  New argument FUNC
specifies a function that can be used as an alternative to running
EXECUTABLE.
(image-dired-create-thumb-1): Don't call
'image-dired--check-executable-exists' here, ...
(image-dired-thumb-queue-run): ...call it here, with
'w32image-create-thumbnail' as the alternative function.  If on
MS-Windows and no "convert" command, call
'image-dired-create-thumb-2' instead.
(image-dired-create-thumb-2): New function.

* etc/NEWS: Announce the thumbnail support.
etc/NEWS
lisp/image/image-dired-external.el
lisp/image/image-dired.el
src/emacs.c
src/w32image.c
src/w32term.h